<template>
  <div class="box">
    <h1>作用域插槽</h1>
    <ul>
      <li v-for="(item, index) in todos" :key="item.id">
<!--        作用域插槽: 将数据回传父组件, 与传props语法相同-->
        <slot :row="item" :index="index"></slot>
      </li>
    </ul>
  </div>
</template>

<script setup lang="ts">
let props = defineProps(['todos']);
console.log(props);
</script>

<style scoped>
.box {
  width: 100vw;
  height: 400px;
  background: skyblue;
}
</style>